<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript">
var setting = {  
        data: {  
               simpleData: {  
                   enable: true,  
                   idKey: "id",  
                   pIdKey: "pId",  
                   rootPId: 0
               },
           },  
	    showLine : true,
        checkable : false,                  //每个节点上是否显示 CheckBox  
		isSimpleData : true,
		callback: {
			onClick: zTreeOnClick
		},
		view:{
			dblClickExpand: false,
			showLine:false//不显示连接线
		}
    }; 
var treeNodes = [   
    {"id":11, "pId":0, "name":"条件定制",icon:"${ctx}/images/tree_icon/folder-open.png"},
    {"id":111, "pId":11, "name":"总控条件",icon:"${ctx}/images/tree_icon/leaf.png"},
    {"id":112, "pId":11, "name":"行条件",icon:"${ctx}/images/tree_icon/leaf.png"},
    {"id":113, "pId":11, "name":"列条件",icon:"${ctx}/images/tree_icon/leaf.png"},
 	{"id":22, "pId":0, "name":"计算定制",icon:"${ctx}/images/tree_icon/folder-open.png"},
 	{"id":221, "pId":22, "name":"行计算",icon:"${ctx}/images/tree_icon/leaf.png"},
    {"id":222, "pId":22, "name":"列计算",icon:"${ctx}/images/tree_icon/leaf.png"},
 	{"id":33, "pId":0, "name":"校核定制",icon:"${ctx}/images/tree_icon/folder-open.png"},
 	{"id":331, "pId":33, "name":"表内校核",icon:"${ctx}/images/tree_icon/leaf.png"},
 	{"id":3331, "pId":331, "name":"行校核",icon:"${ctx}/images/tree_icon/leaf.png"},
 	{"id":3332, "pId":331, "name":"列校核",icon:"${ctx}/images/tree_icon/leaf.png"},
 	{"id":3333, "pId":331, "name":"单元格校核",icon:"${ctx}/images/tree_icon/leaf.png"},
    {"id":332, "pId":33, "name":"表间校核",icon:"${ctx}/images/tree_icon/leaf.png"},
 ];
var zTreeDemo = null;
$(document).ready(function(){//初始化ztree对象     
	  zTreeDemo = $.fn.zTree.init($("#cityTree"),setting, treeNodes);  
	});  

//点击树节点生成不同的表格
function zTreeOnClick(event, treeId, treeNode) {
	if(treeNode.id == '111'){
		queryZkConditions();
		$("#zongkongButton").show();
		$("#hongButton").hide();
		$("#lieButton").hide();
		$("#lieButton1").hide();
		$("#hongButton1").hide();		$("#hangValidationButton").hide();
		$("#lieValidationButton").hide();
		$("#cellValidationButton").hide();
		$("#rptValidationButton").hide();
	}
	else if(treeNode.id == '112'){
		queryHangConditions();
		$("#zongkongButton").hide();
		$("#hongButton").show();
		$("#lieButton").hide();
		$("#lieButton1").hide();
		$("#hongButton1").hide();		
		$("#hangValidationButton").hide();
		$("#lieValidationButton").hide();
		$("#cellValidationButton").hide();
		$("#rptValidationButton").hide();
	}
	else if(treeNode.id == '113'){
		queryLieConditions();
		$("#zongkongButton").hide();
		$("#hongButton").hide();
		$("#lieButton").show();
		$("#lieButton1").hide();
		$("#hongButton1").hide();		
		$("#hangValidationButton").hide();
		$("#lieValidationButton").hide();
		$("#cellValidationButton").hide();
		$("#rptValidationButton").hide();
	}
	else if(treeNode.id == '221'){
		queryHangCount();
		$("#hongButton1").show();
		$("#lieButton1").hide();
		$("#zongkongButton").hide();
		$("#hongButton").hide();
		$("#lieButton").hide();
		$("#hangValidationButton").hide();
		$("#lieValidationButton").hide();
		$("#cellValidationButton").hide();
		$("#rptValidationButton").hide();
	}
	else if(treeNode.id == '222'){
		queryLieCount();
		$("#hongButton1").hide();
		$("#lieButton1").show();
		$("#zongkongButton").hide();
		$("#hongButton").hide();
		$("#lieButton").hide();
		$("#hangValidationButton").hide();
		$("#lieValidationButton").hide();
		$("#cellValidationButton").hide();
		$("#rptValidationButton").hide();
	}
	else if(treeNode.id == '3331'){
		queryRowValidations();
		$("#zongkongButton").hide();
		$("#hongButton").hide();
		$("#lieButton").hide();
		$("#lieButton1").hide();
		$("#hongButton1").hide();
		$("#hangValidationButton").show();
		$("#lieValidationButton").hide();
		$("#cellValidationButton").hide();
		$("#rptValidationButton").hide();
	}
	else if(treeNode.id == '3332'){
		queryColValidations();
		$("#zongkongButton").hide();
		$("#hongButton").hide();
		$("#lieButton").hide();
		$("#lieButton1").hide();
		$("#hongButton1").hide();
		$("#hangValidationButton").hide();
		$("#lieValidationButton").show();
		$("#cellValidationButton").hide();
		$("#rptValidationButton").hide();
	}
	else if(treeNode.id == '3333'){
		queryCellValidations();
		$("#zongkongButton").hide();
		$("#hongButton").hide();
		$("#lieButton").hide();
		$("#lieButton1").hide();
		$("#hongButton1").hide();
		$("#hangValidationButton").hide();
		$("#lieValidationButton").hide();
		$("#cellValidationButton").show();
		$("#rptValidationButton").hide();
	}
	else if(treeNode.id == '332'){
		queryRptValidations();
		$("#zongkongButton").hide();
		$("#hongButton").hide();
		$("#lieButton").hide();
		$("#lieButton1").hide();
		$("#hongButton1").hide();
		$("#hangValidationButton").hide();
		$("#lieValidationButton").hide();
		$("#cellValidationButton").hide();
		$("#rptValidationButton").show();
	}
}
	

</script>
</head>

<body style="padding:10px">
	<div id="layout2" style="width:100%">
     	 <div position="left" title="菜单">
     	 	<ul id="cityTree" class="ztree"></ul>
     	 </div>
         <div position="center" title="无" id="centerDivTitle">
			  <div id="zongkongtiaojian" style="display:none;width:100%;height:100%">
			  	  <%@ include file="/WEB-INF/jsp/report-design/report-template-conditions-zk.jsp"%>
			  </div>
			  <div id="hangtiaojian" style="display:none;width:100%;height:100%">
			  	  <%@ include file="/WEB-INF/jsp/report-design/report-template-conditions-hang.jsp"%>
			  </div>
			  <div id="lietiaojian" style="display:none;width:100%;height:100%">
			  	  <%@ include file="/WEB-INF/jsp/report-design/report-template-conditions-lie.jsp"%>
			  </div>
			  <div id="hangtiaojian1" style="display:none;width:100%;height:100%">
			  	  <%@ include file="/WEB-INF/jsp/report-design/report-template-customized-hang.jsp"%>
			  </div>
			  <div id="lietiaojian1" style="display:none;width:100%;height:100%">
			  	  <%@ include file="/WEB-INF/jsp/report-design/report-template-customized-lie.jsp"%>
			  </div>
			  <div id="rowValidation" style="display:none;width:100%;height:100%">
			  	  <%@ include file="/WEB-INF/jsp/report-design/report-template-validation-hang.jsp"%>
			  </div>
			  <div id="cellValidation" style="display:none;width:100%;height:100%">
			  	  <%@ include file="/WEB-INF/jsp/report-design/report-template-validation-lie.jsp"%>
			  </div>
			  <div id="cellValidation" style="display:none;width:100%;height:100%">
			  	  <%@ include file="/WEB-INF/jsp/report-design/report-template-validation-cell.jsp"%>
			  </div>
			  <div id="cellValidation" style="display:none;width:100%;height:100%">
			  	  <%@ include file="/WEB-INF/jsp/report-design/report-template-validation-rpt.jsp"%>
			  </div>
			  <div style="margin-right:15px;margin-top:5px;padding:5px;border:0px solid green;position:relative;">
				<div class="control-group">
					<div class="controls">
						<div class="controls">
							<input id="zongkongButton" type="button" class="btn btn-info" value="新增总控条件" onclick="newZongkong();" style="display:none"/>
							<input id="hongButton" type="button" class="btn btn-info" value="新增行条件" onclick="newHang();" style="display:none"/>
							<input id="lieButton" type="button" class="btn btn-info" value="新增列条件" onclick="newLie();" style="display:none"/>
							<input id="hongButton1" type="button" class="btn btn-info" value="新增行计算" onclick="newHang1();" style="display:none"/>
							<input id="lieButton1" type="button" class="btn btn-info" value="新增列计算" onclick="newLie1();" style="display:none"/>
							<input id="hangValidationButton" type="button" class="btn btn-info" value="新增行校核" onclick="newValidateRow();" style="display:none"/>
							<input id="lieValidationButton" type="button" class="btn btn-info" value="新增列校核" onclick="newValidationCol();" style="display:none"/>
							<input id="cellValidationButton" type="button" class="btn btn-info" value="新增单元格校核" onclick="newcellValidation();" style="display:none"/>
							<input id="rptValidationButton" type="button" class="btn btn-info" value="新增表间校核" onclick="newrptValidation();" style="display:none"/>
						</div>
					</div>
				</div>
			  </div>
			  <div id="maingrid" style="margin:5px; padding:0;height:90%"></div>
			  <div style="display:none;"></div>
         </div>
           
     </div> 
</body>
</html>